<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<title>info_list.html</title>

<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">

<!-- index import css start -->
<link rel="stylesheet" href="<%=path%>/css/info_list.css"> 
<link rel="stylesheet" href="<%=path%>/css/bootstrap-combined.css">
<link rel="stylesheet" href="<%=path%>/css/date/jquery.datetimepicker.css">
<!-- index import css end --> 
</head>

<body>

	<jsp:include page="top.jsp"></jsp:include>
	
	<div class="container-fluid divBlock "> 

		<div class="searchDiv">
			<label style="height:34px;line-height:34px;float:left;">开始时间</label>
				<input type="text" value="" class="datetimepicker" style="height:34px;float:left;" id="datetimepicker_mask_start"/>
			<label style="height:34px;line-height:34px;float:left;">结束时间</label>
				<input type="text" value="" class="datetimepicker" style="height:34px;float:left;" id="datetimepicker_mask_end"/>
			<div class="dropdown" style="float:left;">
			   <button type="button" class="btn dropdown-toggle" id="dropdownMenu1" 
			      data-toggle="dropdown" style="width:100px;">日志级别<span class="caret"></span>
			   </button>
			   <ul class="dropdown-menu" role="menu" 
			      aria-labelledby="dropdownMenu1">
			      <li role="presentation"> <!-- FATAL:0  ERROR:3  WARN:4  INFO:6   DEBUG:7  -->
			         <a role="menuitem" class="cp" tabindex="-1" href="javascript:void(0);" >DEBUG</a>
			      </li> 
			      <li role="presentation"> 
			         <a role="menuitem" class="cp" tabindex="-1" href="javascript:void(0);" >INFO</a>
			      </li>
			      <li role="presentation"> 
			         <a role="menuitem" class="cp" tabindex="-1" href="javascript:void(0);" >WARN</a>
			      </li>
			      <li role="presentation">
			         <a role="menuitem" class="cp" tabindex="-1" href="javascript:void(0);" >ERROR</a>
			      </li>
			      <li role="presentation">
			         <a role="menuitem" class="cp" tabindex="-1" href="javascript:void(0);" >FATAL</a>
			      </li>
			   </ul>
			</div>
			<button class="btn btn-info info_list_search_btn" id="log_info_list_search_btn">查询</button>
			
		</div>

		<div class="row cotainer table-responsive infoTable">
			<table class="table table-striped table-bordered">
				<caption class="text-center">
					<h3>日志列表</h3> 
				</caption>
				<thead>
					<tr >
						<td class=" hidden-xs"  style="text-align:center;">
							<input type="checkbox" id="checkAll" value="">
							<button class="btn btn-warning" id="log_list_delAll_btn">删除</button>
						</td>
						<td class="  " style="text-align:center;">级别</td>
						<td class=" hidden-xs"  style="text-align:center;">时间</td>
						<td class=" "  style="text-align:center;">耗时</td>
						<td class=" "  style="text-align:center;">操作</td>
					</tr>
				</thead>
				<tbody id="log_list_table_tbody">

					<%-- <s:iterator value="#curData" var="loginfo">
						<tr>
							<td class=" hidden-xs" style="text-align:center;">
								<input type=checkbox name="abc" value="${loginfo.uuid }"></td>
							<td class="" style="text-align:center;">
								${loginfo.priority}
							</td>
							<td class=" hidden-xs" style="text-align:center;">
								${loginfo.logDate}
							</td>
							<td class=" " style="text-align:center;">${loginfo.rmseconds}</td> 
							<td class="" style="text-align:center;">
								<a href="<%=basePath%>log_details.action?id=${loginfo.uuid }">详情</a> | <a href='javascript:void(0);' onclick="delLog('<%=basePath %>','${loginfo.uuid }')" id="log_list_del">删除</a>
							</td>
						</tr>
					</s:iterator> --%>


					<!-- <td colspan="3" class="page_tocenter">
							<ul class="pagination">
							  <li><a href="#">&laquo;</a></li>
							  <li class="active"><a href="#">1</a></li>
							  <li><a href="#">2</a></li>
							  <li><a href="#">3</a></li>
							  <li><a href="#">&raquo;</a></li>
							</ul>
						</td> -->
				</tbody>

			</table>
			<div class="span12 toCenter">
				<div id="log_list_pager"></div>
			</div>
		</div>
	</div>
	 
	<jsp:include page="footer.jsp"></jsp:include>
		
	<script type="text/javascript" src="<%=path%>/js/bootstrap-paginator.js"></script>
	<script type="text/javascript" src="<%=path%>/js/info_list.js"></script>
	 
	<!-- date js -->
	<script type="text/javascript" src="<%=path%>/js/date/jquery.datetimepicker.js"></script>
	<!--  -->
	
	<script type="text/javascript">
		var path='<%=basePath%>'; 
		$(function() {
			
			/* 初始化分页  */ 
			try{
				initLogListPage(path,"${pageBean.curPage}","${pageBean.totalPages}");
			}catch(e){
				
			}
			
			/* 点击全部删除  */
			$('#log_list_delAll_btn').click(function(){
				delLogs(path);
			});
			
			/* 单个删除  */
			$("#log_list_del").click(
				function(){ 
					console.log("delete..");
					delLog(path,"${loginfo.uuid }");
				}
			)
			/* 全选/取消选中  */
			$("#checkAll").bind("click", function() {
				if (this.checked) {
					$("input[type=checkbox]").prop("checked", 'true');
				} else {
					$("input[type=checkbox]").removeAttr("checked");
				}
			});
			
			
			
			/* 时间控件 */ 
			$('.datetimepicker').datetimepicker();
			$('.datetimepicker').datetimepicker({lang:'ch',//中文化
			});
			$('.datetimepicker').datetimepicker({
				mask:'9999/19/39 29:59' 
			});
			$("#datetimepicker_mask_start").val('${startTime}');
			$("#datetimepicker_mask_end").val('${endTime}');
			
			/* 条件查询日志  */
			$("#log_info_list_search_btn").click(function(){
				searchLogs(path,1,$("#datetimepicker_mask_start").val(),$("#datetimepicker_mask_end").val(),$("#dropdownMenu1").text());
			});
			 
			$(".cp").click(function(){
				changeTp(this.innerText);
			})
			function changeTp(v){
				$("#dropdownMenu1").text(v);
			}
			refreshLogTable(path,1,$("#datetimepicker_mask_start").val(),$("#datetimepicker_mask_end").val(),"");

		})
		
	</script>
</body>
</html>
